//
//  ASTabBar.h
//
//  Created by apple on 14-9-16.
//  Copyright (c) 2014年. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
    ASTabBarPositionTop = 0,
    ASTabBarPositionRight,
    ASTabBarPositionBottom,
    ASTabBarPositionLeft,
}ASTabBarPosition;

typedef enum {
    ASTabBarLayoutStrategyStrungTogether = 0,
    ASTabBarLayoutStrategyEvenlyDistributed,
    ASTabBarLayoutStrategyCentered
}ASTabBarLayoutStrategy;

#define kASTabBarPositionDefault    ASTabBarPositionBottom


NS_INLINE BOOL ASBarIsVertical(ASTabBarPosition position) {
    return position == ASTabBarPositionLeft || position == ASTabBarPositionRight;
}

NS_INLINE BOOL ASTabBarIsHorizontal(ASTabBarPosition position) {
    return position == ASTabBarPositionTop || position == ASTabBarPositionBottom;
}


@interface ASTabBar:UIView
@property (nonatomic, strong) NSArray *items;
@property (nonatomic, assign) NSUInteger selectedItemIndex;
@property (nonatomic, assign) ASTabBarPosition position;
@property (nonatomic, assign) ASTabBarLayoutStrategy layoutStrategy;
/** the padding to apply between items, not taken into account when layoutStrategy is EvenlyDistributed */
@property (nonatomic, assign) CGFloat itemPadding;

/** defaults to black */
@property (nonatomic, strong) UIColor *tintColor;
/** defaults to nil */
@property (nonatomic, strong) UIImage *backgroundImage;
/** flag whether the semi-transparent item highlight is shown */
@property (nonatomic, assign) BOOL showsItemHighlight;
/** defaults to white */
@property (nonatomic, strong) UIColor *itemHighlightColor;

- (void)selectItemAtIndex:(NSUInteger)index;
- (void)deselectSelectedItem;
@end
